<script>

        function safetostring(str) {
            return String(str).replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, "'");
        }
        var nickname = '${zbuser.nickname}';
        var headimgurl = "${zbuser.headimgurl}";
        var city = "${zbuser.city}";
        if(city == ""){
            var city = "火星";
        }

        $("#list").html($("#scene").html());
        setTimeout(function(){
            $(".data-name").text(safetostring(nickname));
            $(".data-avt").attr("src",headimgurl);
            $(".data-city").text(safetostring(city));

            var cw = $('.list-img').width();
            $('.list-img').css({'height':cw+'px'});
        },0);
        $(window).resize(function() {
            var cw = $('.list-img').width();
            $('.list-img').css({'height':cw+'px'});
        });

        $(document.body).show();
        function hideActionSheet(weuiActionsheet, mask) {
            weuiActionsheet.removeClass('weui_actionsheet_toggle');
            mask.removeClass('weui_fade_toggle');
            weuiActionsheet.on('transitionend', function () {
                mask.hide();
            }).on('webkitTransitionEnd', function () {
                mask.hide();
            })
        }

        function showActionSheet(weuiActionsheet, mask) {
            // var mask = $('#mask');
            // var weuiActionsheet = $('#weui_actionsheet');
            weuiActionsheet.addClass('weui_actionsheet_toggle');
            mask.show().addClass('weui_fade_toggle').click(function () {
                hideActionSheet(weuiActionsheet, mask);
            });
            $('.actionsheet_cancel').click(function () {
                hideActionSheet(weuiActionsheet, mask);
            });
            weuiActionsheet.unbind('transitionend').unbind('webkitTransitionEnd');
        }

        $('#list').not( ".noplayimg" ).on('click', function () {
            weuiActionsheet = $('#actionSheet_wrap').children('#weui_actionsheet');
            mask = $('#actionSheet_wrap').children('#mask');
            showActionSheet(weuiActionsheet,mask);
        });
        $('img').not( ".noplayimg" ).on('click', function (e) {
            weuiActionsheet = $('#actionSheet_wrap').children('#weui_actionsheet');
            mask = $('#actionSheet_wrap').children('#mask');
            showActionSheet(weuiActionsheet,mask);
        });

        $('#gotoplay').click(function(){
            weuiActionsheet = $('#actionSheet_wrap').children('#weui_actionsheet');
            mask = $('#actionSheet_wrap').children('#mask');
            showActionSheet(weuiActionsheet,mask);
        });

        $('.play_pyq').unbind('click').on('click', function () {
            weuiActionsheet = $('#actionSheet_wrap').children('#weui_actionsheet');
            mask = $('#actionSheet_wrap').children('#mask');
            var scene = "";
            var scene = $(this).attr("data-scene");
            //alert(scene);
            hideActionSheet(weuiActionsheet, mask);
            checktype(scene);
            
        });

        function checktype(scene){
            weuiActionsheet = $('#actionSheet_wrap_child').children('#weui_actionsheet_child');
            mask = $('#actionSheet_wrap_child').children('#mask_child');
            showActionSheet(weuiActionsheet,mask);

            $('.play_type').unbind('click').click(function(){
                var type = $(this).attr("data-type");
                gotoplay(scene,type);
            })
        }


        function gotoplay(scene,type) {
            var gourl = "${CONTEXT_PATH}/zb/duang?openid=${zbuser.openid}&sence="+type+"&sex="+scene;
            location.href=gourl;
        };
        
        

    </script>